package Time;

import java.util.Scanner;

public class TimeHourTest {
    public static void main(String[] args){
        Scanner sc =new Scanner(System.in);
        while(sc.hasNextInt()){
            int ah=sc.nextInt(),am=sc.nextInt(),as=sc.nextInt();
            int bh=sc.nextInt(),bm=sc.nextInt(),bs=sc.nextInt();
            TimeHour a =new TimeHour(ah,am,as);
            TimeHour b =new TimeHour(bh,bm,bs);
            TimeHour c =a.add(b);
            System.out.println(c);
        }
    }
}
